package databaseStructs

import (
	"time"

	"github.com/its-a-feature/Mythic/utils/structs"
)

type Payload struct {
	ID                  int               `db:"id" json:"id"`
	UuID                string            `db:"uuid" json:"uuid"`
	Description         string            `db:"description" json:"description"`
	OperatorID          int               `db:"operator_id" json:"operator_id"`
	Operator            Operator          `db:"operator" json:"-"`
	CreationTime        time.Time         `db:"creation_time" json:"creation_time"`
	PayloadTypeID       int               `db:"payload_type_id" json:"payload_type_id"`
	Payloadtype         Payloadtype       `db:"payloadtype" json:"-"`
	OperationID         int               `db:"operation_id" json:"operation_id"`
	Operation           Operation         `db:"operation" json:"-"`
	WrappedPayloadID    structs.NullInt64 `db:"wrapped_payload_id" json:"wrapped_payload_id,omitempty"`
	Deleted             bool              `db:"deleted" json:"deleted"`
	BuildContainer      string            `db:"build_container" json:"build_container"`
	BuildPhase          string            `db:"build_phase" json:"build_phase"`
	BuildMessage        string            `db:"build_message" json:"build_message"`
	BuildStderr         string            `db:"build_stderr" json:"build_stderr"`
	BuildStdout         string            `db:"build_stdout" json:"build_stdout"`
	CallbackAlert       bool              `db:"callback_alert" json:"callback_alert"`
	AutoGenerated       bool              `db:"auto_generated" json:"auto_generated"`
	Os                  string            `db:"os" json:"os"`
	TaskID              structs.NullInt64 `db:"task_id" json:"task_id,omitempty"`
	FileID              structs.NullInt64 `db:"file_id" json:"file_id,omitempty"`
	Filemeta            Filemeta          `db:"filemeta" json:"-"`
	Timestamp           time.Time         `db:"timestamp" json:"timestamp"`
	EventStepInstanceID structs.NullInt64 `db:"eventstepinstance_id" json:"event_step_instance_id" mapstructure:"event_step_instance_id"`
	APITokensID         structs.NullInt64 `db:"apitokens_id" json:"api_tokens_id" mapstructure:"apitokens_id"`
	CallbackAllowed     bool              `db:"callback_allowed" json:"callback_allowed" mapstructure:"callback_allowed"`
}
